Skip to content

Unify icon contributions and clarify supported formats#450

Open
brisvag wants to merge 14 commits into
napari:mainfrom
brisvag:fix/icon-contributions
Open

Unify icon contributions and clarify supported formats#450
brisvag wants to merge 14 commits into
napari:mainfrom
brisvag:fix/icon-contributions

Conversation

@brisvag
Copy link
Copy Markdown
Contributor

@brisvag brisvag commented Apr 3, 2026

This PR aims to unify a bit the manifest regarding icons, and to bring it more in line with what the underlying app-model accepts.

We actually "officially" support more things than appmodel (e.g: https urls), and I'm not sure whether we plan to keep these and handle the extra logic ourselves or what else to do. At least with this we start supporting dark/light for all icon fields.

Copy link
Copy Markdown
Contributor

@willingc willingc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Seems to have a circular import that in the tests.

Comment thread src/npe2/manifest/_validators.py Outdated
@brisvag
Copy link
Copy Markdown
Contributor Author

brisvag commented Apr 13, 2026

Since it's not reused, I just moved the validator to the model where it's needed.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cd9f583) to head (e386a81).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #450   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           37        37           
  Lines         2795      2802    +7     
=========================================
+ Hits          2795      2802    +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/npe2/manifest/schema.py Outdated
Comment thread src/npe2/manifest/contributions/_commands.py Outdated
Comment thread src/npe2/manifest/contributions/_submenu.py Outdated
@brisvag brisvag added the enhancement New feature or request label May 13, 2026
Comment thread tests/test_manifest.py
PluginManifest(name="myplugin", icon="my_plugin:myicon.png")
pm = PluginManifest(name="myplugin", icon="my_plugin:myicon.png")
assert pm.icon == "my_plugin:myicon.png"
pm = PluginManifest(name="myplugin", icon="https://example.com/icon.png")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we should allow remote icons in plugins. This is a big privacy issue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is a really important point, it let's someone track things, like the 1px by 1px white image in your emails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants